return IA64_NO_FAULT;
}
-
-int ia64_map_hypercall_param(void)
-{
- struct vcpu *v = current;
- struct domain *d = current->domain;
- u64 vaddr = v->arch.hypercall_param.va & PAGE_MASK;
- volatile pte_t* pte;
-
- if (v->arch.hypercall_param.va == 0)
- return FALSE;
- pte = lookup_noalloc_domain_pte(d, v->arch.hypercall_param.pa1);
- if (!pte || !pte_present(*pte))
- return FALSE;
- vcpu_itc_no_srlz(v, 2, vaddr, pte_val(*pte), -1UL, PAGE_SHIFT);
- if (v->arch.hypercall_param.pa2) {
- vaddr += PAGE_SIZE;
- pte = lookup_noalloc_domain_pte(d, v->arch.hypercall_param.pa2);
- if (pte && pte_present(*pte)) {
- vcpu_itc_no_srlz(v, 2, vaddr, pte_val(*pte),
- -1UL, PAGE_SHIFT);
- }
- }
- ia64_srlz_d();
- return TRUE;
-}
(sizeof(vcpu_info_t) * (v)->vcpu_id + \
offsetof(vcpu_info_t, evtchn_upcall_mask))
-struct hypercall_param {
- unsigned long va;
- unsigned long pa1;
- unsigned long pa2;
-};
-
struct arch_vcpu {
/* Save the state of vcpu.
This is the first entry to speed up accesses. */
char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
char hypercall_continuation;
- struct hypercall_param hypercall_param; // used to remap a hypercall param
-
//for phycial emulation
unsigned long old_rsc;
int mode_flags;
extern unsigned long __must_check __copy_user (void __user *to, const void __user *from,
unsigned long count);
-extern int ia64_map_hypercall_param(void);
-
static inline unsigned long
__copy_to_user (void __user *to, const void *from, unsigned long count)
{
- unsigned long len;
- len = __copy_user(to, (void __user *)from, count);
- if (len == 0)
- return 0;
- if (ia64_map_hypercall_param())
- len = __copy_user(to, (void __user *)from, count); /* retry */
- return len;
+ return __copy_user(to, (void __user *)from, count);
}
static inline unsigned long
__copy_from_user (void *to, const void __user *from, unsigned long count)
{
- unsigned long len;
- len = __copy_user((void __user *)to, from, count);
- if (len == 0)
- return 0;
- if (ia64_map_hypercall_param())
- len = __copy_user((void __user *) to, from, count); /* retry */
- return len;
+ return __copy_user((void __user *)to, from, count);
}
#define __copy_to_user_inatomic __copy_to_user